-
Notifications
You must be signed in to change notification settings - Fork 0
Group Tree #101
Open
donald
wants to merge
10
commits into
master
Choose a base branch
from
grouptree
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Group Tree #101
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add django-treebeard [1] to requirements. Note, that django-treebeard is already requested by wagtail, because it is also used by wagtail for its pages. [1] https://django-treebeard.readthedocs.io/
Update requirements with (cd requirements && make)
Use MP_Node for Group and remove priority field.
Add migration. Add the column "path" without the unique constraint and an invalid value first. Next, go over all group objects and set a path from a sequential index. Use alphabetical order, so that menus displayed be tree are in the same order as before unless sorted by the admin. As a last step add the unique contraint.
Add TreeAdmin for groups. Note, that TreeAdmin is based on Djangos ModelAdmin, not on Wagtails ModelAdmin. So we hook into Djangos admin-interface (available at /django-admin) Disable CSRF_COOKIE_HTTPONLY, because TreeAdmin uses Ajax over http to arrange the group tree.
The <hr> before the "Reset filter" entry is not needed, because its at the top of the box. We already have a visual separation between "Reset filter" and the group names, because the later are in the .dropdown-content div, which as a little border. Remove <hr> element.
Add groups in tree order instead of alphabetical order to the context of the contacts page alphabetical order. Groups will be shown in that order in the drop-down menu.
Add a method which can be used by a template to get a number of entities based on the depth of the group, Note: Yes, this is an ugly mixture of code and style. Should be fixed up by some clever CSS using the depth attribute only.
Use Group.get_depth_fill method to get some indention into the group pulldown menu.
Now the Wagtai ladmin "add group" page fail (depth NULL constraint)... Need more work. |
Sign in
to join this conversation on GitHub.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prototype for #31
Let contact groups be arrange in a tree in the backend and give subgroups depth based indention in the dropdown menu. Code needs cleanup.